package com.bwie.es.controller;

import com.bwie.common.domain.request.GoodsQueryReq;
import com.bwie.common.domain.response.GoodsQueryRes;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.es.service.GoodsEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/es")
public class GoodsEsController {

    @Autowired
    private GoodsEsService goodsEsService;

    /**
     * 搜索
     * @param goodsQueryReq
     * @return
     */
    @PostMapping("/search")
    public Result<PageResult<GoodsQueryRes>> search(@RequestBody GoodsQueryReq goodsQueryReq){
        Result <PageResult<GoodsQueryRes>> result = goodsEsService.search(goodsQueryReq);
        return result;
    }
}
